package com.fy.module.qu.common.exception;

import com.fy.module.qu.common.vo.ApiRest;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 江迪
 */
//@ControllerAdvice
public class ExceptionResolver {


    @ExceptionHandler(ServiceException.class)
    @ResponseBody
    public ApiRest handle(ServiceException exception){
        return ApiRest.failure(exception.getMessage(),null);
    }
}
